//
//  ProductIntroduceViewController.m
//  DriftDog
//
//  Created by rimi on 15/9/13.
//  Copyright (c) 2015年 廖马林. All rights reserved.
//

#import "ProductIntroduceViewController.h"

static NSString *const introduceText = @"《流浪狗》是专门为养狗爱狗人士做的一款app，主要功能有发帖和即时聊天，为大家提供了一个很好的交流平台，我们可以在其中为自己的爱狗爱好增长经验，也未自己在工作之余有一个很好的放松形式。";

@interface ProductIntroduceViewController ()

@property(nonatomic, strong) UILabel *introduceLabel;

- (void)initializeUserInterface;

@end

@implementation ProductIntroduceViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    [self initializeUserInterface];
}

#pragma mark - init

- (void)initializeUserInterface {

    self.view.backgroundColor = [UIColor colorWithWhite:236 / 255.f alpha:1];
    
    /* 添加子类控件 */
    [self.view addSubview:self.introduceLabel];
    
    /* 添加父类控件 */
    [self addTitleLabelWithName:@"产品简介"];
    [self addBaseLeftButtonWithImage:[UIImage imageNamed:@"返回图标"]];
    [self.baseLeftButton addTarget:self action:@selector(respondsToBaseLeftButton:) forControlEvents:UIControlEventTouchUpInside];
    
   
}

#pragma mark - responds event

- (void)respondsToBaseLeftButton:(UIButton *)sender {

    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - getter

- (UILabel *)introduceLabel {

    if (!_introduceLabel) {
        
        _introduceLabel = [[UILabel alloc] initWithFrame:DHFlexibleFrame(CGRectMake(0, 75, ORIGIN_WIDTH - 30, ORIGIN_HEIGHT - 600), NO)];
        _introduceLabel.center = CGPointMake(self.view.center.x, 150);
        _introduceLabel.backgroundColor = [UIColor colorWithWhite:236 / 255.f alpha:1];
        _introduceLabel.numberOfLines = 0;
        _introduceLabel.text = introduceText;
        _introduceLabel.textColor = [UIColor colorWithWhite:0.6 alpha:1];
        _introduceLabel.font = [UIFont systemFontOfSize:17 * DHFlexibleVerticalMutiplier()];
        _introduceLabel.textAlignment = NSTextAlignmentJustified;
        
    }
    return _introduceLabel;
}

@end
